import * as tslib_1 from "tslib";
import { observable, action } from "mobx";
import request from "../utils/request";
import * as api from "../api/api";
import { LoadHoc, loading } from "../hoc/loadHoc";
let FinancialCenterStore = class FinancialCenterStore extends LoadHoc {
  constructor() {
    super(...arguments);
    /**
     * 查询工程项目信息
     */
    this.allProjectInfo = {};
    /**
     * 查询工程项目详细信息
     */
    this.projectInfo = {};
    /**
     * 查询工商服务中心所有动态信息
     */
    this.allCompanyTaxReturn = {};
    /**
     * 查询建企资质服务中心信息
     */
    this.allQualificationServiceCenterInfo = {};
    /**
     * 查询建企资质服务中心信息-详情
     */
    this.qualificationServiceCenterInfo = {};
  }
  async getAllProjectInfo(params) {
    const { provinceId, cityId, districtId, pageSize, pageIndex, callback } = params;
    const allProjectInfo = await request(api.AppfinancialCenterApiFetchParamCreactor.appfinancialCenterGetAllProjectInfoAsync({
      formProvinceId: provinceId,
      formCityId: cityId,
      formDistrictId: districtId,
      formSkipCount: (pageIndex - 1) * pageSize,
      formMaxResultCount: pageSize
    }));
    this.allProjectInfo = allProjectInfo;
    callback && callback(allProjectInfo);
  }
  async getProjectInfo(params) {
    const { id, callback } = params;
    const projectInfo = await request(api.AppfinancialCenterApiFetchParamCreactor.appfinancialCenterGetProjectInfoAsync({
      formId: id
    }));
    this.projectInfo = projectInfo;
    callback && callback(projectInfo);
  }
  /**
   * 保存工程项目信息
   */
  async saveProjectInfo(params) {
    const { form, callback } = params;
    await request(api.AppfinancialCenterApiFetchParamCreactor.appfinancialCenterSaveProjectInfoAsync({
      form
    }));
    callback && callback();
  }
  async getAllCompanyTaxReturn(params) {
    const { pageIndex, pageSize, callback } = params;
    const allCompanyTaxReturn = await request(api.AppfinancialCenterApiFetchParamCreactor.appfinancialCenterGetAllCompanyTaxReturnAsync({
      formSkipCount: (pageIndex - 1) * pageSize,
      formMaxResultCount: pageSize
    }));
    this.allCompanyTaxReturn = allCompanyTaxReturn;
    callback && callback(allCompanyTaxReturn);
  }
  /**
   * 保存工商服务中心信息
   */
  async saveCompanyTaxReturn(params) {
    const { form, callback } = params;
    const res = await request(api.AppfinancialCenterApiFetchParamCreactor.appfinancialCenterSaveCompanyTaxReturnAsync({
      form
    }));
    callback && callback(res);
  }
  async getAllQualificationServiceCenterInfo(params) {
    const { qualificationsType, areaCode, pageIndex, pageSize, callback } = params;
    const allQualificationServiceCenterInfo = await request(api.AppfinancialCenterApiFetchParamCreactor.appfinancialCenterGetAllQualificationServiceCenterInfoAsync({
      formQualificationsType: qualificationsType,
      formAreaCode: areaCode,
      formSkipCount: (pageIndex - 1) * pageSize,
      formMaxResultCount: pageSize
    }));
    this.allQualificationServiceCenterInfo = allQualificationServiceCenterInfo;
    callback && callback(allQualificationServiceCenterInfo);
  }
  async getQualificationServiceCenterInfo(params) {
    const { formId, callback } = params;
    const qualificationServiceCenterInfo = await request(api.AppfinancialCenterApiFetchParamCreactor.appfinancialCenterGetQualificationServiceCenterInfoAsync({
      formId
    }));
    this.qualificationServiceCenterInfo = qualificationServiceCenterInfo;
    callback && callback(qualificationServiceCenterInfo);
  }
  /**
   * 保存建企资质服务中心信息
   */
  async saveQualificationServiceCenter(params) {
    const { form, callback } = params;
    const res = await request(api.AppfinancialCenterApiFetchParamCreactor.appfinancialCenterSaveQualificationServiceCenterAsync({
      form
    }));
    callback && callback(res);
  }
  /**
   * 保存工程项目预约
   */
  async saveProjectSubscribe(params) {
    const { form, callback } = params;
    const res = await request(api.AppfinancialCenterApiFetchParamCreactor.appfinancialCenterSaveProjectSubscribeAsync({
      form
    }));
    callback && callback(res);
  }
  /**
   * 保存工程现金
   */
  async saveProjectCashcs(params) {
    const { form, callback } = params;
    const res = await request(api.AppfinancialCenterApiFetchParamCreactor.appfinancialCenterSaveProjectCashcsAsync({
      form
    }));
    callback && callback(res);
  }
  /**
   * 工程金融中心项目数量
   */
  async getCount(params) {
    const { callback } = params;
    const res = await request(api.AppfinancialCenterApiFetchParamCreactor.appfinancialCenterGetCountAsync({}));
    callback && callback(res);
  }
  /**
   * 工商服务中心项目数量
   */
  async getCompanyTaxReturnCount(params) {
    const { callback } = params;
    const res = await request(api.AppfinancialCenterApiFetchParamCreactor.appfinancialCenterGetCompanyTaxReturnCountAsync({}));
    callback && callback(res);
  }
  /**
   * 保存保函信息第一步
   */
  async saveInfoAndCalculationMoney(params) {
    const { form, callback } = params;
    const res = await request(api.AppfinancialCenterApiFetchParamCreactor.appfinancialCenterSaveInfoAndCalculationMoneyAsync({
      form
    }));
    callback && callback(res);
  }
  /**
   * 保存保函信息第二步
   */
  async saveSuretyBondInfo(params) {
    const { form, callback } = params;
    const res = await request(api.AppfinancialCenterApiFetchParamCreactor.appfinancialCenterSaveSuretyBondInfoAsync({
      form
    }));
    callback && callback(res);
  }
};
export { FinancialCenterStore as default };

tslib_1.__decorate([observable], FinancialCenterStore.prototype, "allProjectInfo", undefined);
tslib_1.__decorate([loading, action], FinancialCenterStore.prototype, "getAllProjectInfo", null);
tslib_1.__decorate([observable], FinancialCenterStore.prototype, "projectInfo", undefined);
tslib_1.__decorate([loading, action], FinancialCenterStore.prototype, "getProjectInfo", null);
tslib_1.__decorate([loading, action], FinancialCenterStore.prototype, "saveProjectInfo", null);
tslib_1.__decorate([observable], FinancialCenterStore.prototype, "allCompanyTaxReturn", undefined);
tslib_1.__decorate([loading, action], FinancialCenterStore.prototype, "getAllCompanyTaxReturn", null);
tslib_1.__decorate([loading, action], FinancialCenterStore.prototype, "saveCompanyTaxReturn", null);
tslib_1.__decorate([observable], FinancialCenterStore.prototype, "allQualificationServiceCenterInfo", undefined);
tslib_1.__decorate([loading, action], FinancialCenterStore.prototype, "getAllQualificationServiceCenterInfo", null);
tslib_1.__decorate([observable], FinancialCenterStore.prototype, "qualificationServiceCenterInfo", undefined);
tslib_1.__decorate([loading, action], FinancialCenterStore.prototype, "getQualificationServiceCenterInfo", null);
tslib_1.__decorate([loading, action], FinancialCenterStore.prototype, "saveQualificationServiceCenter", null);
tslib_1.__decorate([loading, action], FinancialCenterStore.prototype, "saveProjectSubscribe", null);
tslib_1.__decorate([loading, action], FinancialCenterStore.prototype, "saveProjectCashcs", null);
tslib_1.__decorate([loading, action], FinancialCenterStore.prototype, "getCount", null);
tslib_1.__decorate([loading, action], FinancialCenterStore.prototype, "getCompanyTaxReturnCount", null);
tslib_1.__decorate([loading, action], FinancialCenterStore.prototype, "saveInfoAndCalculationMoney", null);
tslib_1.__decorate([loading, action], FinancialCenterStore.prototype, "saveSuretyBondInfo", null);